package com.ruoyi.project.system.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.SysGoodsCommentMapper;
import com.ruoyi.project.system.domain.SysGoodsComment;
import com.ruoyi.project.system.service.ISysGoodsCommentService;

/**
 * 二手物品评论Service业务层处理
 * 
 * @author jjp
 * @date 2020-04-21
 */
@Service
public class SysGoodsCommentServiceImpl implements ISysGoodsCommentService 
{
    @Autowired
    private SysGoodsCommentMapper sysGoodsCommentMapper;

    /**
     * 查询二手物品评论
     * 
     * @param commentId 二手物品评论ID
     * @return 二手物品评论
     */
    @Override
    public SysGoodsComment selectSysGoodsCommentById(Long commentId)
    {
        return sysGoodsCommentMapper.selectSysGoodsCommentById(commentId);
    }

    /**
     * 查询二手物品评论列表
     * 
     * @param sysGoodsComment 二手物品评论
     * @return 二手物品评论
     */
    @Override
    public List<SysGoodsComment> selectSysGoodsCommentList(SysGoodsComment sysGoodsComment)
    {
        return sysGoodsCommentMapper.selectSysGoodsCommentList(sysGoodsComment);
    }

    @Override
    public List<SysGoodsComment> selectSysGoodsCommentLists(SysGoodsComment sysGoodsComment) {
        return sysGoodsCommentMapper.selectSysGoodsCommentLists(sysGoodsComment);
    }

    /**
     * 新增二手物品评论
     * 
     * @param sysGoodsComment 二手物品评论
     * @return 结果
     */
    @Override
    public int insertSysGoodsComment(SysGoodsComment sysGoodsComment)
    {
        sysGoodsComment.setCreateDate(DateUtils.getNowDate());
        return sysGoodsCommentMapper.insertSysGoodsComment(sysGoodsComment);
    }

    /**
     * 修改二手物品评论
     * 
     * @param sysGoodsComment 二手物品评论
     * @return 结果
     */
    @Override
    public int updateSysGoodsComment(SysGoodsComment sysGoodsComment)
    {
        return sysGoodsCommentMapper.updateSysGoodsComment(sysGoodsComment);
    }

    /**
     * 批量删除二手物品评论
     * 
     * @param commentIds 需要删除的二手物品评论ID
     * @return 结果
     */
    @Override
    public int deleteSysGoodsCommentByIds(Long[] commentIds)
    {
        return sysGoodsCommentMapper.deleteSysGoodsCommentByIds(commentIds);
    }

    /**
     * 删除二手物品评论信息
     * 
     * @param commentId 二手物品评论ID
     * @return 结果
     */
    @Override
    public int deleteSysGoodsCommentById(Long commentId)
    {
        return sysGoodsCommentMapper.deleteSysGoodsCommentById(commentId);
    }

    @Override
    public int deleteSysGoodsCommentByParentId(Long commentId) {
        return sysGoodsCommentMapper.deleteSysGoodsCommentByParentId(commentId);
    }

    @Override
    public List<SysGoodsComment> queryAllParent(SysGoodsComment sysGoodsComment) {
        return sysGoodsCommentMapper.queryAllParent(sysGoodsComment);
    }
}
